package net.hn.hnms.biz.analysis.domain.enums;

import lombok.Getter;

@Getter
public enum AlarmEnum {
    ALARM_BLUE0(0,"蓝色"),
    ALARM_BLUE1(1,"蓝色"),
    ALARM_YELLOW1(2,"黄色1级"),
    ALARM_YELLOW2(3,"黄色2级"),
    ALARM_ORANGE1(4,"橙色1级"),
    ALARM_ORANGE2(5,"橙色2级"),
    ALARM_ORANGE3(6,"橙色3级"),
    ALARM_RED(7,"红色");


    private final int code;

    private final String desc;

    AlarmEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static AlarmEnum getAlarmEnum(int code) {
        for (AlarmEnum alarmEnum : AlarmEnum.values()) {
            if (alarmEnum.getCode() == code) {
                return alarmEnum;
            }
        }
        return null;
    }

}
